package com.blood.event;

import com.blood.modules.system.service.IFTPService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 事件监听器
 *
 * @author daoren
 */
@Slf4j
@Component
public class BloodEventListener {
    @Autowired
    private IFTPService ftpService;

    @EventListener
    @Async("bloodAsyncExecutor")
    public void batchRemove(VisitUploadEvent event) {
        log.info("随访上传删除旧文件");
        ftpService.batchRemove(event.getFilePathList());
    }


}
